# 这是一步一步引导式的构建爬虫

# 首先第一步，简单爬取到页面元数据
import requests

# 假设目标网址已存储在 web_url 中
web_url = "https://item.jd.com/100123056051.html"

headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
}

# 发起 GET 请求
response = requests.get(web_url, headers=headers)

# 检查请求是否成功
if response.status_code == 200:
    # 获取网页内容
    page_content = response.text
    print(page_content)
else:
    print(f"请求失败，状态码: {response.status_code}")